import request from '@/api/request'
import type { BetFormDTO, CommonParams, CreateGameResultDto, CreateUserDto, DisposeOddRuleDto, OddRulesQueryDto, Result } from './jackpot-dto'

export const JackpotApi = {
    getJackpotGameUserList: (params: CommonParams): Promise<Result<any>> => {
        return request.post('/jackpot/getJackpotGameUserList', params)
    },
    addJackpotUser: (params: CreateUserDto): Promise<Result<any>> => {
        return request.post('/jackpot/addJackpotUser', params)
    },
    deleteJackpotUser: (params: { userId: string }): Promise<Result<any>> => {
        return request.post('/jackpot/deleteJackpotUser', params)
    },
    recharge: (params: { userId: string, amount: number }): Promise<Result<any>> => {
        return request.post('/jackpot/recharge', params)
    },

    getGameResultList: (params: CommonParams): Promise<Result<any>> => {
        return request.post('/jackpot/getGameResultList', params)
    },
    addGameResult: (params: CreateGameResultDto): Promise<Result<any>> => {
        return request.post('/jackpot/addGameResult', params)
    },
    openGameResult: (params: { gameResultId: string }): Promise<Result<any>> => {
        return request.post('/jackpot/openGameResult', params)
    },
    getOddRuleList: (params: OddRulesQueryDto): Promise<Result<any>> => {
        return request.post('/jackpot/getOddRuleList', params)
    },
    disposeOddRule: (params: DisposeOddRuleDto): Promise<Result<any>> => {
        return request.post('/jackpot/disposeOddRule', params)
    },
    deleteOddRule: (params: { ruleId: string }): Promise<Result<any>> => {
        return request.post('/jackpot/deleteOddRule', params)
    },
    bet(params: BetFormDTO): Promise<Result<any>> {
        return request.post('/jackpot/bet', params)
    }
}
